Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
"Where clause" is not working in AWS Athena

data sample

I used AWS Glue Console to create a table from S3 bucket in Athena. You can see a relevant part on the screenshot above. I obfuscated column name, so assume the column name is "a test column". I would like to select the records with value D in that column. The query I tried to run is:

SELECT 
    * 
FROM 
    table 
WHERE 
    "a test column" = "D"

Nothing is returned. I also tried to use IS instead of =, as well as to surround D with single quotes instead of double quotes within the WHERE clause:

-- Tried this
WHERE 
    "a test column" = 'D'

-- Tried this
WHERE 
    "a test column" IS "D"

-- Tried this
WHERE 
    "a test column" IS 'D'

Nothing works. Can someone help? Thank you.

The error message I got is

Mismatched input 'where' expecting (service: amazon athena; status code: 400; error code: invalid request exception; request id: 8f2f7c17-8832-4e34-8fb2-a78855e3c17d)

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Problem with the query syntax. Use single quotes (') when you refer to a string values, because double quotes refer to a column name in your table.

SELECT 
    * 
FROM 
    table 
WHERE 
    "column_name" = 'D'
over 4 years ago · Santiago Trujillo Relatório

0

The unexpected answer (also apologize if I did not say it clearly in the original post) is that, I cannot add "limit 200" in front of the where clause. I have to add it in the end. Hope it helps others.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda